﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace MTO.Framework.Common.DataAnnotations
{
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
    public class PhoneAttribute : RegularExpressionAttribute
    {
        public PhoneAttribute()
            : base(@"(1-)?\d{3}-\d{3}-\d{4}")
        {
            this.ErrorMessage = Resources.DataAnnotationsResources.PhoneAttribute_ValidationError; 
        }
    }
}
